using System.Collections.Generic;
using Microsoft.Data.Schema.ScriptDom.Sql;
//using System.Diagnostics;
using System;
using System.IO;
using System.Text.RegularExpressions;


namespace Neznayka
{
    internal class CheckUniqueIndexHasNoNullColumnsVisitor : TSqlConcreteFragmentVisitor
    {
        private List<ColumnWithSortOrder> _objects;

        #region ctor
        public CheckUniqueIndexHasNoNullColumnsVisitor()
        {
            _objects = new List<ColumnWithSortOrder>();
        }
        #endregion

        #region properties
        public List<ColumnWithSortOrder> Objects
        {
            get { return _objects; }
        }
        #endregion

        #region overrides
        public override void ExplicitVisit(CreateIndexStatement node)
        {
            //find unique indexes that are not filtered
            if (node.Unique )
            {
                if (node.FilterPredicate == null)
                {
                    foreach (var v in node.Columns)
                    {
                        _objects.Add(v);
                    }
                }
            }
        }

        #endregion

    }


}